import { reserveStore } from '@/stores/reserve-store';
import { getSafeArea } from '@/utils/others';
import { storeBindingsBehavior } from 'mobx-miniprogram-bindings';

Page({
  behaviors: [storeBindingsBehavior],
  storeBindings: {
    store: reserveStore,
    fields: ['reserveList'],
    actions: ['getReserveList', 'resetReserveList'],
  },
  data: {
    safeArea: getSafeArea(),
  },
  onLoad() {
    this.resetReserveList();
    this.getReserveList();
  },
  onPullDownRefresh() {
    this.resetReserveList();
    this.getReserveList();
  },
  onReachBottom() {
    this.getReserveList();
  },
  onClickLeft() {
    wx.navigateBack();
  },
});
